<%@ page language="java" contentType="text/html;charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>客房设施状态</title>
<style type="text/css">
	table.altrowstable {
	    qont-family: verdana,arial,sans-serif;
		    font-size:14px;
		    border-width: 1px;
		    border-color: #a9c6c9;
		    border-collapse: collapse;
		   
		    text-align:center;
		}
		table.altrowstable th {
		    border-width: 1px;
		    padding: 8px;
		     width: 200px;
		    height: 100px;
		    border-style: solid;
		    border-color: #131a1b;
		}
		table.altrowstable td {
		    border-width: 1px;
		    padding: 8px;
		    border-style: solid;
		    border-color: #131a1b;
		}
		.oddrowcolor{
		    background-color:#d4e3e5;
		}
		.evenrowcolor{
		    background-color:#c3dde0;
		}
</style>
</head>
<body>
	<form action="">
		<div align="center">
			<table class="altrowstable" id="alternatecolor">
				<tr><td></td><td>序号</td><td>房号</td><td>灯泡</td><td>电脑</td><td>灭火器</td><td>淋浴</td><td>空调</td><td>床上用品</td><td>电视</td><td>沙发</td><td>备注</td></tr>
				<c:forEach items="${facilityQuery}" var="item">
					<tr>
						<td><input type="checkbox" class="id" name="iId" value="${item.iId}" /></td>
						<td>${item.iId}</td>
						<td><input type="hidden" class="roomName" value="${item.sRoomName}"/> ${item.sRoomName}</td>
						<c:if test="${item.iLight==1}"><td>正常</td></c:if><c:if test="${item.iLight==-1}"><td>损坏</td></c:if>
						<c:if test="${item.iComputer==1}"><td>正常</td></c:if><c:if test="${item.iComputer==-1}"><td>损坏</td></c:if>
						<c:if test="${item.iExtinguisher==1}"><td>正常</td></c:if><c:if test="${item.iExtinguisher==-1}"><td>损坏</td></c:if>
						<c:if test="${item.iShower==1}"><td>正常</td></c:if><c:if test="${item.iShower==-1}"><td>损坏</td></c:if>
						<c:if test="${item.iAirCondition==1}"><td>正常</td></c:if><c:if test="${item.iAirCondition==-1}"><td>损坏</td></c:if>
						<c:if test="${item.iBedding==1}"><td>正常</td></c:if><c:if test="${item.iBedding==-1}"><td>损坏</td></c:if>
						<c:if test="${item.iTV==1}"><td>正常</td></c:if><c:if test="${item.iTV==-1}"><td>损坏</td></c:if>
						<c:if test="${item.iSofa==1}"><td>正常</td></c:if><c:if test="${item.iSofa==-1}"><td>损坏</td></c:if>
						<td>${item.sMessage}</td>
					</tr>
				</c:forEach>
				<tr ><td colspan="11">
				<a href = "room/getRoomFacility.action?page=1" >首页</a>  
				<a href = "room/getRoomFacility.action?page=${facility.page-1}" id="">上一页</a>  
				<a href = "room/getRoomFacility.action?page=${facility.page+1}">下一页</a>  
				<a href = "room/getRoomFacility.action?page=${facility.pages}">尾页</a> 
				第${facility.page}页/共 ${facility.pages}页 
			</td></tr>
				<tr><td colspan="12"><input type="button" value="修改" onclick="doclick()"/><input type="button" value="返回" onclick="window.location='jsp/login/logout.jsp'"/></td></tr>
			</table>
		</div>
	</form>
</body>
	<script type="text/javascript" src="js/jquery-3.2.1.js"></script>
	<script type="text/javascript">
		function doclick(){
			if($(".id:checked").length!=1){
				alert("请选择一项进行修改");
				return false;
			}
			window.location = "jsp/room/updateFacility.jsp?sRoomName="+$(".roomName").eq($(".id:checked").val()-1).val();
		}
	</script>
</html>